package com.nutquest.client;
import java.io.*;


/**
 * The Class userInput.
 */
public class userInput extends Thread
{
	
	/* (non-Javadoc)
	 * @see java.lang.Thread#run()
	 */
	public void run()
	{
		BufferedReader kin = new BufferedReader(new InputStreamReader(System.in));		
		while(true)
		{
	
			if (NutQuestClient.logout)
			{
				return;
			}
			
		
			try
			{
				String command = kin.readLine();
				if (command.equals("Logout"))
				{
					NutQuestClient.send(command);
					
					String response = NutQuestClient.readString();
					NutQuestClient.logout = true;
					return;
				}
				else
				{
					NutQuestClient.send(command);
				}
			}
			catch (Exception e)
			{
				
			}
		}
	}
}
